import fetch from '@/utils/fetch';

export function login(siteid, username, password) {
  return fetch({
    url: '/site/'+ siteid +'/admin/login',
    method: 'post',
    data: {
      username,
      password
    }
  });
}

export function getInfo(token) {
  return fetch({
    url: '/user/info',
    method: 'get',
    params: { token }
  });
}

export function logout() {
  return fetch({
    url: '/logoutuser',
    method: 'get'
  });
}

export function getSite() {
    return fetch({
        url: '/site',
        method: 'get'
    });
}
